package com.example.finaltool.utils;

import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;

public class KeyUtils {
    private KeyUtils(){}
    public static List<String> keysOf(Class<?> clazz) {
        Field[] fields = clazz.getDeclaredFields();
        List<String> values = new ArrayList<>(fields.length);
        for (Field field : fields) {
            field.setAccessible(true);
            try {
                values.add((String) field.get(clazz));
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            }
        }
        return values;
    }
}
